package com.yehongyu.mytools.basic.grammar;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Java002_ArrayAndList {
	
	public static void main(String[] args){
		String[] strs = {};
		System.out.println(strs.length);
		for(int i=0;i<strs.length;i++){
			System.out.println(strs[i]);
		}
		for(String s:strs){
			System.out.println(s);
		}
		
		List<?> sList = Collections.EMPTY_LIST;
		for(int i=0;i<sList.size();i++){
			System.out.println(strs[i]);
		}
		
		List<String> aa = new ArrayList<String>();
		aa.add("test_aa");
		aa.add("test_BB");
		System.out.println(aa.toString());
		System.out.println(aa.toString().replaceAll("\\[", "'").replaceAll("\\]", "'").replaceAll(", ", "','"));
		List<Long> idList = new ArrayList<Long>();
//		idList.add(123L);
//		idList.add(345L);
		System.out.println(idList.toString());
		System.out.println(idList.isEmpty());
		System.out.println(idList.toString().replace('[', ' ').replace(']', ' '));
		List<Integer> a = new ArrayList<Integer>();
		a.add(1);
		a.add(2);
		a.add(3);
		List<Integer> b = new ArrayList<Integer>();
		b.add(1);
		b.add(3);
		a.removeAll(b);
		System.out.println("--"+a.contains(2));
//		System.out.println(a);111->7  101->5 10->2  11->3 100->4
	}

}
